package com.rookie.data.generate.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ResultCodeEnum {
    /*
     * 系统相关的错误提示信息
     * */
    C_200("200", "请求成功"),
    E_400("400", "请求处理异常，请稍后再试"),
    E_401("401", "操作失败，请稍候重试"),
    E_500("500", "请求方式有误,请检查 GET/POST"),
    E_501("501", "请求路径不存在"),
    E_503("503", "请求处理异常，请稍后再试");

    private final String code;

    private final String msg;


    public static ResultCodeEnum getCode(String code) {
        for (ResultCodeEnum resultCodeEnum : ResultCodeEnum.values()) {
            if (resultCodeEnum.getCode().equals(code)) {
                return resultCodeEnum;
            }
        }
        return null;
    }

}